﻿// See https://aka.ms/new-console-template for more information
using HelloInstance;

Console.WriteLine("Hello, World!");


Instance.GetInstance().Test();


public class Client
{
    public void Run()
    {
        Console.WriteLine("单线程客户端启动......");
        Console.WriteLine("---------");
        for (int i = 0; i < 20; i++)
        {
            Instance instance = Instance.GetInstance();
            instance.Test();
        }
        Console.WriteLine("---------");
    }
    public void TaskRun()
    {
        Console.WriteLine("多线程客户端客户端启动......");
        Console.WriteLine("---------");
        for (int i = 0; i < 20; i++)
        {
            Task.Run(() => {
                Instance instance = Instance.GetInstance();
                instance.Test();
            });
        }
        Console.WriteLine("---------");
    }
}



